<?php
namespace Application\Repository;
use Doctrine\ORM\EntityRepository;

class CommentActivityRepository extends AbstractRepository
{
    protected $table="comment_activity";
    
    public function getByCommentId($commentId,$number = 30)
    {
    	$dql = "SELECT c FROM comment_activity c WHERE c.comment_id=?1";
    
    	return $this->getEntityManager()->createQuery($dql)
    	->setParameter(1, $commentId)
    	->setMaxResults($number)
    	->getResult();
    }
}